<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let n = 100;
        let r = typeof n;
        console.log(r);  //number
        

        // 数字转字符串
        let num = 1;
        // 数字和字符串相加，+号会把数字转字符串然后做拼接
        let num2 = num + ''; // '1'
        // 字符串和数字相减，-号会把字符串转数字然后做减法
        let num3 = num2 - 0; // 1
        console.log(typeof num2);
        

        let a = 20;
        let b = 20

        // 0 ,null,undefined，NaN,''都是false，其他都是true
        if(a - b){
            console.log("不相等");
            
        }else{
            console.log("相等");
            
        }
        
    </script>
</body>
</html>